import request from './request.js'

export function getRecordsPageByCondition(currentPage, pageSize, searchConditions){
	return request({
		url: '/record/page',
		method: 'POST',
		params:{ currentPage, pageSize },
		data: {
			conditions: searchConditions
		}
	})
}

export function addRecord(form){
	return request({
		url: '/record',
		method: 'POST',
		data: { ...form }
	})
}

export function delRecord(id){
	return request({
		url: '/record',
		method: 'DELETE',
		params: { id }
	})
}

//批量删除文件
export function delRecordByBatch(recordIdsStr){
	return request({
		url: '/record/batch',
		method: 'DELETE',
		params:{ recordIdsStr }
	})
}

// 今日是否打卡
export function isClock(uid){
	return request({
		url: '/record/today',
		method: 'GET',
		params: { uid }
	})
}

// 通知打卡
export function sendEmail(email){
	return request({
		url: '/email/notice',
		method: 'GET',
		params: { email }
	})
}